clear
clc
close

rosinit('192.168.6.188',11311);

sub = rossubscriber('/map','nav_msgs/OccupancyGrid');
mapMsg = receive(sub);
occGrid = readOccupancyGrid(mapMsg);
show(occGrid);
rosshutdown;

% https://ww2.mathworks.cn/help/nav/ref/occupancymap.html